<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:s="http://jboss.com/products/seam/taglib"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:f="http://java.sun.com/jsf/core">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>Seam Example By Karthikeyan C</title>
       
    </head>
    <body>
        <h:form>
            <rich:messages/>
            <s:validateAll>

                <rich:panel id="homepanel">
                    <f:facet name="header">
                       Seam Example 
                    </f:facet>
                    <h:panelGrid columns="2">
                        <h:outputText value="Employee Name:"/>
                        <h:inputText value="#{employeeaction.employee.name}" required="true"/>

                        <h:outputText value="Email:"/>
                        <h:inputText value="#{employeeaction.employee.email}" required="true"/>


                        <h:commandButton action="#{employeeaction.createEmployee}" value="Create Employee"/>
                    </h:panelGrid>
                    <br/>
                    List of Existing Employees
                    <br/>
                    <rich:dataTable value="#{employeeList}" var="emp">
                        <rich:column>
                            <f:facet name="header">
                               Name
                            </f:facet>
                            <h:inputText value="#{emp.name}"/>
                        </rich:column>
                        <rich:column>
                            <f:facet name="header">
                                Email
                            </f:facet>
                            <h:inputText value="#{emp.email}"/>
                        </rich:column>
                        <rich:column>
                            <f:facet name="header">
                                Update
                            </f:facet>
                            <h:commandButton action="#{employeeaction.update}" value="Update"/>
                        </rich:column>

                    </rich:dataTable>
                </rich:panel>
            </s:validateAll>
        </h:form>
    </body>
</html>
